﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Sort descending order</title>
    <link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
	<div id="js-console"></div>
	<script src="scripts/js-console.js"></script>

    <script>
        var firstNumber = 5;
        var secondNumber = 3;
        var thirdNumber = 1;
        var biggestNumber=0;
        var middleNumber=0;
        var smallestNumber=0;

        if (firstNumber >= secondNumber && firstNumber >= thirdNumber) {
            biggestNumber = firstNumber;

            if (secondNumber >= thirdNumber) {
                middleNumber = secondNumber;
                smallestNumber = thirdNumber;
            }
            else {
                middleNumber = thirdNumber;
                smallestNumber = secondNumber;
            }
        }

        if (secondNumber >= firstNumber && secondNumber >= thirdNumber) {
            biggestNumber = secondNumber;

            if (firstNumber >= thirdNumber) {
                middleNumber = firstNumber;
                smallestNumber = thirdNumber;
            }
            else {
                middleNumber = thirdNumber;
                smallestNumber = firstNumber;
            }
        }

        if (thirdNumber >= firstNumber && thirdNumber >= secondNumber) {      
            biggestNumber = thirdNumber;

            if (firstNumber >= secondNumber) {
                middleNumber = firstNumber;
                smallestNumber = secondNumber;
            }
            else {
                middleNumber = secondNumber;
                smallestNumber = firstNumber;
            }
        }

        jsConsole.writeLine(biggestNumber);
        jsConsole.writeLine(middleNumber);
        jsConsole.writeLine(smallestNumber);

    </script>
</body>
</html>
